<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>   
   <%@ include file="common-js.jsp" %>
   
        <script>
    	var rpcUrl = "<%=path%>/auth/common-rpc";
    	$(document).ready(function() {
    		
		  $('#submit').click(function () {   		   				
		    	callRpcMethod("getRecentWeiboPosts",[],function (result) {                  
		        $('#message').html(result);
		        var recentWeiboPostList = $('#recentWeiboPostList');
		        $.each(result.result.list,function(i,post){
					recentWeiboPostList.append("<li>"+post.content);
					if(post.retweeted != null)
					{
						recentWeiboPostList.append("<br/>"+post.retweeted.content);
					}					
					recentWeiboPostList.append("</li>");
				});    
		    });	
		    return false;    
		  }); 
		  
		  $('#single').click(function () {   		   				
		    	callRpcMethod("getWeiboPost",["1"],function (result) {                  
		        $('#message').html(result);
		        var recentWeiboPostList = $('#recentWeiboPostList');
		      	recentWeiboPostList.append("<li>"+result.result.content+"</li>");
				  
		    });	
		    return false;    
		  }); 
		  
		  
		}); 
    </script>
    
    
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
  <body>
    This is my JSP page. <br>
   <div id="message"></div>
   <div id="recentWeiboPost">
     <ul id="recentWeiboPostList">    	
     </ul>
   </div> 
   
   <input type="submit" id="submit"/>
   <input type="submit" id="single"/>
   
   <div class="demo">
   <div id="progressbar"></div>
   </div>
  </body>
</html>
